<template>
    <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="() => { $router.push('/'); }" />
    <router-link v-for="item in goodsData" :to="'/xiangqing/'+item.goods_id">
        <van-card  :price="item.goods_price"  :title="item.goods_name"
            :thumb="item.goods_small_logo">
        </van-card>
    </router-link>
</template>

<script setup>
import { ref } from 'vue';
import { goodsApi } from '@/api/api'
import { useRoute } from 'vue-router';
let route = new useRoute
const goodsData = ref([])
goodsApi(route.params.cat_id).then(res => {
    console.log('分类列表', res)
    goodsData.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>